There are some image data processing devices configured to execute so-called gradation conversion in which N-bit image data is converted to M-bit image data having a reduced gradation number. Such gradation conversion is executed by, for example, simply cutting off a value of low-order N-M bits of the N-bit pixel data to execute quantization to M-bit pixel data. However, in this case, there may be a problem in which a band-like pattern, namely, banding is sensed due to influence of a quantization error in an area where a pixel value gradually changes like a gradation portion inside an image.
In related arts, various kinds of methods (types) of suppressing such banding are known as banding suppression processing, for example: a random dither method, a systematic dither method, an error diffusion method, etc. (refer to Patent Document 1, for example).
FIG. 22A is a diagram illustrating an exemplary gradation conversion device configured to apply banding suppression processing according to the random dither method. The gradation conversion device includes an arithmetic unit 311, a random noise output unit 312, and a quantization unit 313.
For example, a pixel value IN(x, y) of each pixel (x, y) of 16-bit image data is supplied to the arithmetic unit 311 in raster scan order as target image data of gradation conversion (as an image before gradation conversion). Note that the pixel (x, y) represents a pixel located at x-th from the left and y-th from the top. Further, random noise is supplied to the arithmetic unit 311 from the random noise output unit 312 configured to generate and output the random noise.
The arithmetic unit 311 adds the pixel value IN(x, y) and the random noise, and supplies the quantization unit 313 with an added value obtained as a result thereof. The quantization unit 313 quantizes the added value from the arithmetic unit 311 to, for example, 8 bits, and outputs the 8-bit quantized value obtained as a result thereof as a pixel value OUT(x, y) of each pixel (x, y) of the image data after gradation conversion.
FIG. 22B is a diagram illustrating an exemplary gradation conversion device configured to apply banding suppression processing according to the systematic dither method. The gradation conversion device includes an arithmetic unit 321 and a quantization unit 322.
For example, a pixel value IN(x, y) of each pixel (x, y) of 16-bit image data is supplied to the arithmetic unit 321 in the raster scan order as a target image of gradation conversion. Further, a dither matrix is supplied to the arithmetic unit 321. The arithmetic unit 321 adds the pixel value IN(x, y) and a value of the dither matrix corresponding to the pixel (x, y) having the pixel value IN(x, y), and supplies the quantization unit 322 with an added value obtain as a result thereof.
The quantization unit 322 quantizes the added value from the arithmetic unit 321 to 8 bits, for example, and outputs the 8-bit quantized value obtained as a result thereof as a pixel value OUT(x, y) of the pixel (x, y) of the image data after gradation conversion.
FIG. 22C is a diagram illustrating an exemplary gradation conversion device configured to apply banding suppression processing according to the error diffusion method. The gradation conversion device includes an arithmetic unit 331, a quantization unit 332, an arithmetic unit 333, and a two-dimensional filter 334.
For example, a pixel value IN(x, y) of each pixel (x, y) of 16-bit image data is supplied to the arithmetic unit 331 in the raster scan order as a target image of gradation conversion. Further, output of the two-dimensional filter 334 is supplied to the arithmetic unit 331. The arithmetic unit 331 adds the pixel value IN(x, y) and the output of the two-dimensional filter 334, and supplies the quantization unit 332 and the arithmetic unit 333 with an added value obtained as a result thereof.
The quantization unit 332 quantizes the added value from the arithmetic unit 331 to 8 bits, for example, and outputs the 8-bit quantized value obtained as a result thereof as a pixel value OUT(x, y) of each pixel (x, y) of the image data after gradation conversion.
Further, the pixel value OUT(x, y) output from the quantization unit 332 is also supplied to the arithmetic unit 333. The arithmetic unit 333 subtracts the pixel value OUT(x, y) of the quantization unit 332 from the added value of the arithmetic unit 331 to obtain a quantization error −Q(x, y) generated from quantization at the quantization unit 332, and supplies the same to the two-dimensional filter 334.
The two-dimensional filter 334 is a two-dimensional filter configured to filter a signal, and filters the quantization error −Q(x, y) from the arithmetic unit 333, and outputs a filtering result to the arithmetic unit 331.
In the arithmetic unit 331, the pixel value IN(x, y) and the result of filtering the quantization error −Q(x, y) output from the two-dimensional filter 334 are added as described above. In this case, the quantization error −Q(x, y) is fed back to an input side (arithmetic unit 331) via the two-dimensional filter 334, thereby forming a two-dimensional ΔΣ modulator.
According to the two-dimensional ΔΣ modulator, the quantization error −Q(x, y) is diffused to a high band of space frequency in both a horizontal direction (x-direction) and a vertical direction (y-direction). Therefore, according to the error diffusion method, an image having better quality can be obtained as an image after gradation conversion, compared to the random dither method and the systematic dither method.
FIGS. 23A to 23C are diagrams illustrating a relation between banding and the above-described dither/error diffusion. Here, an example is provided in the case where N=16 and M=8, more specifically, gradation is converted by quantizing 16-bit image data to 8-bit image data. In this case, quantization is executed by cutting off lower-order 8 bits of the input 16-bit data.
A case where a gradation image as illustrated in FIG. 23A is input as original 16-bit image data will be described. In the case of not executing the dither or the error diffusion at the time of quantizing the 16-bit image data to 8-bit image data, discontinuity of gradation, namely, banding may be caused as illustrated in FIG. 23B. A cause of such banding is that a flat portion having continuous same pixel values is generated more in the 8-bit case than the 16-bit case due to decrease of resolution as illustrated on the right side of FIG. 23B.
In the case of executing the dither or the error diffusion, flattening of the pixel values is reduced as illustrated on the right side of FIG. 23C. As a result, expressing the gradation closer to the original 16-bit image data can be achieved as illustrated on the left side of FIG. 23C. Thus, it can be grasped that dither and error diffusion are the methods to express the gradation with dot density.